<template>
	<view>
		<rich-text :nodes="details"></rich-text>
	</view>
</template>

<script>
	import http from '../../utils/http';
	export default {
		data() {
			return {
				details: ''
			};
		},
		onShow() {
			http.request('base/configData')
				.then((res) => {
					// this.content = res.data.gg ? res.data.gg.replace(/<img/g, '<img class="rich-text-img"') : '';
					this.details = this.content(res.data.details)
				})
				.catch((res) => {
					uni.showToast({
						title: res.message,
						icon: 'none'
					});
				});
		},
		methods: {
			content(res) {
				let html;
				if (res) {
					html = res.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"');
				}
				return html;
			},
		},
	}
</script>

<style lang="scss">

</style>